package net.lovesrc.allin;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;

@Component
public class WebConfig implements ServletContextAware, InitializingBean {

    private ServletContext sc;

    @Override
    public void afterPropertiesSet() throws Exception {
        sc.setAttribute("path", sc.getContextPath());
        sc.setAttribute("stm", System.currentTimeMillis());
        sc.setAttribute("isDev", true);
    }

    @Override
    public void setServletContext(ServletContext sc) {
        this.sc = sc;
    }

}
